\documentclass[11pt]{article}
%\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{rotating}
\usepackage{placeins}
\graphicspath{ {images/} }
%\usepackage[bottom]{footmisc} 
\usepackage{amsmath}
\usepackage{caption}
\usepackage{grffile}
\usepackage{gensymb}
\usepackage{subcaption}
\usepackage{xr}
\usepackage{prettyref}
\newrefformat{Stab}{Table~\ref{#1}}
\newrefformat{Sfig}{Fig.~\ref{#1}}
\usepackage[plain]{fancyref}
\usepackage[top=0.8in,bottom=0.8in]{geometry}
\usepackage{setspace}
\singlespacing
%\onehalfspacing
%\doublespacing
%\setstretch{1.1}
\usepackage{array}
\usepackage{multirow}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{dcolumn}
\usepackage{amssymb}
\usepackage{verbatim}
\usepackage{natbib}
\usepackage{hyperref}
\usepackage{pdflscape}
 
% *****************************************************************
% Estout related things
% *****************************************************************
\newcommand{\sym}[1]{\rlap{#1}}% Thanks to David Carlisle

\let\estinput=\input% define a new input command so that we can still flatten the document

\newcommand{\estwide}[3]{
		\vspace{.75ex}{
			\begin{tabular*}
			{\textwidth}{@{\hskip\tabcolsep\extracolsep\fill}l*{#2}{#3}}
			\toprule
			\estinput{#1}
			\bottomrule
			\addlinespace[.75ex]
			\end{tabular*}
			}
		}	

\newcommand{\estauto}[3]{
		\vspace{.75ex}{
			\begin{tabular}{l*{#2}{#3}}
			\toprule
			\estinput{#1}
			\bottomrule
			\addlinespace[.75ex]
			\end{tabular}
			}
		}

% Allow line breaks with \\ in specialcells
	\newcommand{\specialcell}[2][c]{%
	\begin{tabular}[#1]{@{}c@{}}#2\end{tabular}}

% *****************************************************************
% Custom subcaptions
% *****************************************************************
% Note/Source/Text after Tables
\newcommand{\figtext}[1]{
	\vspace{-1.9ex}
	\captionsetup{justification=justified,font=footnotesize}
	\caption*{\hspace{6pt}\hangindent=1.5em #1}
	}
\newcommand{\fignote}[1]{\figtext{\emph{Note:~}~#1}}

\newcommand{\figsource}[1]{\figtext{\emph{Source:~}~#1}}

% Add significance note with \starnote
\newcommand{\starnote}{\figtext{* p < 0.1, ** p < 0.05, *** p < 0.01. Standard errors in parentheses.}}

% *****************************************************************
% siunitx
% *****************************************************************
\usepackage{siunitx} % centering in tables
	\sisetup{
		detect-mode,
		tight-spacing		= true,
		group-digits		= false ,
		input-signs		= ,
		input-symbols		= ( ) [ ] - + *,
		input-open-uncertainty	= ,
		input-close-uncertainty	= ,
		table-align-text-post	= false
        }





\begin{document}


\section*{Main Text Figures}
\FloatBarrier
\begin{figure}[!h]
\centering
\begin{subfigure}[t]{0.6\textwidth}
\centering
\includegraphics[width=0.9\linewidth]{tempdiv_figureA.png}
\caption{}\label{fig:F1a}
\end{subfigure}


\begin{subfigure}[t]{0.6\textwidth}
\centering
\includegraphics[width=0.9\linewidth]{tempdiv_figureB.png}
\caption{}\label{fig:F1b}
\end{subfigure}
\captionsetup{width=.8\linewidth}

\end{figure}









\begin{figure}[!t]
\begin{subfigure}[t]{0.45\textwidth}
\centering
\includegraphics[width=0.9\linewidth]{Fig1a.png}
\caption{}\label{fig:F1a}
\end{subfigure}
\hspace{0.05\linewidth}
\begin{subfigure}[t]{0.45\textwidth}
\centering
\includegraphics[width=0.9\linewidth]{Fig1b.png}
\caption{}\label{fig:F1b}
\end{subfigure}

\end{figure}

\begin{figure}[!t]
\begin{subfigure}[t]{0.49\textwidth}
\centering
\includegraphics[width=0.99\linewidth]{Fig2a.png}
\caption{}\label{fig:F2a}
\end{subfigure}
\begin{subfigure}[t]{0.49\textwidth}
\centering
\includegraphics[width=0.99\linewidth]{Fig2b.png}
\caption{}\label{fig:F2b}
\end{subfigure}

\label{fig:F2}
\end{figure}

\begin{figure}[!t]
\begin{subfigure}[t]{0.9\textwidth}
\includegraphics[width=0.99\linewidth]{example-image-a}
\centering

\caption{Indonesian temperature exposure}
\end{subfigure}

\begin{subfigure}[t]{0.9\textwidth}
\centering
\includegraphics[width=0.99\linewidth]{example-image-a}
\caption{Indonesian pov levels }
\end{subfigure}
\caption{\textbf{Note:} Maps are made by hand in ArcGIS. Data to replicate the maps is in EffectMapping.csv. For replication instructions contact the authors. }
\end{figure}

\FloatBarrier
\section*{Main Text Tables}
\FloatBarrier

\begin{table}[!h]
\caption{Average Annual U.S. Payroll Losses 2040-50}
\label{tab:T2}
\estwide{table_projection.tex}{5}{c}

\end{table}





\FloatBarrier
\section*{SI Tables}
\setcounter{table}{0}
\renewcommand{\thetable}{SI\arabic{table}}
\setcounter{figure}{0}
\renewcommand{\thefigure}{SI\arabic{figure}}
\FloatBarrier
\begin{table}
\caption{Main Table}
\estwide{main_table.tex}{6}{c}

\label{table1}
\end{table}

\begin{landscape}
\begin{table}
\caption{Main Table - Alternative Dividend Measures}
\estauto{main_table_SI.tex}{9}{c}

\label{table1}
\end{table}
\end{landscape}

\begin{table*}[tbhp]
\centering
\caption{Marginal impact of an additional 90$\degree$F day on per capital payroll -- AC}
\label{tab:AC}
\estwide{SITable3.tex}{6}{c}
\end{table*}

\begin{table*}[tbhp]
\centering
\caption{Marginal impact of an additional 90$\degree$F day on per capital payroll -- Highly Exposed}
\label{Stab:HE}
\estwide{SITable4.tex}{6}{c}

\end{table*}

\begin{table}[h]
\caption{Projected differences in hot days, 2040-50}
\label{tab:other}
{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{tabular*}{1.0\hsize}{@{\hskip\tabcolsep\extracolsep\fill}l*{5}{c}}
\hline\hline
\input{table2.tex}
\hline\hline
\end{tabular*}
}

\end{table}

\begin{table}[h]
\caption{Heat Index vs. Dry Bulb}
\label{tab:hivdb}
{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{tabular*}{1.0\hsize}{@{\hskip\tabcolsep\extracolsep\fill}l*{4}{c}}
\hline\hline
\input{HIvDryBulb.tex}
\hline\hline
\end{tabular*}
}

\end{table}

\begin{table*}[tbhp]
\centering
\caption{Marginal impact of an additional 90$\degree$F day on per capital payroll -- top-coded}
\label{tab:top}
\estwide{SITable2.tex}{6}{c}

\end{table*}






\begin{table}[tbhp]
\centering
\caption{Summary Stats}
\begin{table}
\input{sumstats.tex}
\end{table}
\end{table}



\FloatBarrier
\section*{SI Figures}
\FloatBarrier



\begin{figure}[tbhp]
\centering
\includegraphics[width=0.8\linewidth]{tempbin_figure.png}

\end{figure}

\begin{figure}[tbhp]
\begin{subfigure}[t]{0.5\textwidth}
\centering
\includegraphics[width=0.9\linewidth]{Dividends Map (1990).png}
\caption{Map of per capita dividends paid in 1990}
\label{Sfig:SIMapA}
\end{subfigure}
\begin{subfigure}[t]{0.5\textwidth}
\centering
\includegraphics[width=0.9\linewidth]{Dividends Map (2010).png}
\caption{Map of per capita dividends paid in 2010}\label{Sfig:SIMapB}
\end{subfigure}
\caption{Map of per capita dividends}
%Notes:
\end{figure}





\begin{figure}[tbhp]
\centering
\includegraphics[width=0.8\linewidth]{PghvDet.png}
\caption{Average per capita dividends paid in Pittsburgh \& Detroit}\label{fig:pghdet}
%Notes:
\end{figure}

\begin{figure}[tbhp]
\centering
\includegraphics[width=0.8\linewidth]{Dividends_time_chart.png}
\caption{Average Dividends Paid 1990-2011}
\label{fig:PrePost}
%Notes:
\end{figure}





\end{document}
